import { Reducer, Effect, Subscription } from 'umi';

export interface LoginModelState {
  demo: any;
}

export interface LoginModelType {
  namespace: 'login';
  state: LoginModelState;
  effects: {
    loginDemo: Effect;
  };
  reducers: {
    save: Reducer<LoginModelState>;
  };
  subscription: {
    setup: Subscription;
  };
}

const LoginModel: LoginModelType = {
  namespace: 'login',
  state: {
    demo: 'demo',
  },
  effects: {
    *loginDemo({ payload }, { call, put }) {},
  },
  reducers: {
    save(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
  subscription: {
    setup() {},
  },
};

export default LoginModel;
